﻿function Add()
{
    var prefix = "ctl00_ContentPlaceHolder1_";
    var companyname = document.getElementById(prefix + "txtCompanyName");
    var headphoto = document.getElementById(prefix + "fuFile");
    var brief = document.getElementById(prefix + "txtBrief");
    var realmname = document.getElementById(prefix + "txtRealmName");

    if (companyname.value.length == 0)
    {
        alert('请输入小组名称');
        companyname.focus();
        return false;
    }
    if (brief.value.length == 0)
    {
        alert('请输入小组简介');
        brief.focus();
        return false;
    }
    if (realmname.value.length == 0)
    {
        alert('请输入个性域名');
        realmname.focus();
        return false;
    }
    else if (!is_zimushuzi(realmname.value))
    {
        alert('个性域名格式不正确');
        realmname.focus();
        return false;
    }
    if (headphoto.value.length == 0)
    {
        alert('请上传小组头像');
        return false;
    }
    return true;
}


function Edit()
{
    var prefix = "ctl00_ContentPlaceHolder1_";
    var companyname = document.getElementById(prefix + "txtCompanyName");
    var brief = document.getElementById(prefix + "txtBrief");
    var changeusername = document.getElementById(prefix + "txtChangeUserName");

    if (companyname.value.length == 0)
    {
        alert('请输入小组名称');
        companyname.focus();
        return false;
    }
    if (brief.value.length == 0)
    {
        alert('请输入小组简介');
        brief.focus();
        return false;
    }
    if (changeusername.value.length > 0)
    {
        return confirm('修改成功后该小组将归他人所有，确定要修改此小组的所有人吗？');
    }
    return true;
}